//
//  UITextField+Chain.m
//  ditelMaintain
//
//  Created by 葛悦彣 on 2023/3/2.
//

#import "UITextField+Chain.h"

@implementation UITextField (Chain)


-(UITextField * _Nonnull (^)(NSString * _Nonnull))addText {
    return ^(NSString * text){
        self.text = text;
        return self;
    };
}
- (UITextField * _Nonnull (^)(UIFont * _Nonnull))addFont {
    return ^(UIFont * font){
        self.font = font;
        return self;
    };
}
- (UITextField * _Nonnull (^)(UIColor * _Nonnull))addTextColor{
    return ^(UIColor * color){
        self.textColor = color;
        return self;
    };
}
- (UITextField * _Nonnull (^)(NSString * _Nonnull))addPlaceholder{
    return ^(NSString * placeholder){
        self.placeholder = placeholder;
        return self;
    };
}

+(instancetype  _Nonnull (^)(void))newTextField {
    return ^(void){
        return [UITextField new];
    };
    
}
- (UITextField * _Nonnull (^)(UIColor * _Nonnull))addbackgroundColor{
    return ^(UIColor * color){
        self.backgroundColor = color;
        return self;
    };
}

@end
